home *** CD-ROM | disk | FTP | other *** search
- Path: ornews.intel.com!news
- From: thurman_b_miller@ccm2.hf.intel.com (Thurman Miller)
- Newsgroups: comp.lang.c++
- Subject: Re: Need suggestion!
- Date: Tue, 09 Jan 1996 18:23:49 GMT
- Organization: Intel Corporation
- Message-ID: <4cubu3$sme@ornews.intel.com>
- References: <4ctnuc$9at@eng_ser1.erg.cuhk.hk>
- NNTP-Posting-Host: thurman-pc.ssd.intel.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- ywleung@cs.cuhk.hk (Marty McFly) wrote:
-
- >Dear All,
-
- > I am writing the user-interface of a program. The program will
- >prompt some message dialogs. The user can click the button inside the
- >dialog and then it will disappear. My question is: Is it a good way to
- >create the dialog each time and "delete" it when the button is clicked?
- >("delete" means freeing the memory) In fact, the message prompting process
- >is very frequent. Will it cause the program to become unstable?
-
- >Regards,
- >Marty McFly.
-
- I doubt if it will make the program unstable, but it will use a lot of
- resources if you are constantly creating and then destroying the
- dialog box.
-
- The best way is to make it modeless (use create to instantiate it) and
- then use member function ShowWindow to either show or hide it. This
- way, it's always around and you are simply making it either visible or
- invisible. BTW, it will probably be a lot easier if you create a
- member function of your app that does the show window so you can
- re-initialize the buttons/controls to their "initial" state.
-
- Thurman Miller
-
-
-